<?php $this->_extends('_layouts/cib_layout'); ?>

<?php $this->_block('metainfo'); ?>
    <title>上海外国语大学国际工商管理学院 —— 文件下载</title>
    <meta name="Description" content="上海外国语大学国际工商管理学院,SISUCIB,文件下载" />
    <meta name="Keywords"    content="上海外国语大学国际工商管理学院,SISUCIB,文件下载" />
    <link rel="stylesheet" type="text/css" href="profiles/<?=Q::ini('appini/skin');?>/cib-file.css" />
    <style type="text/css" media="all"><?=$css;?></style>
<?php $this->_endblock('metainfo'); ?>

<?php $this->_block('container'); ?>
<div id="container">
    <?php $this->_element('g-pieces/file/g-pieces-file-column-a');?>

    <div class="files tz754">
        <h2>文件</h2>
        <table>
            <?php if(!$files->isEmpty()) { ?>
            <thead>
            <tr>
                <th class="filename">名称</th>
                <th class="downloadurl">下载</th>
                <th class="size">大小</th>
                <th class="created">上传时间</th>
            </tr>
            </thead>
            <?php } ?>
            <?php if(isset($_GET['fq'])) { ?>
            <tr>
                <td colspan="4">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="4" class="result-note"><b>搜索结果：共有 <?=$files->count();?> 个文件符合关键字"<?=$_GET['fq'];?>"</b></td>
            </tr>
            <?php } ?>
            <tr>
                <td colspan="4"> &nbsp;</td>
            </tr>
            <tr>
            <?php $Gctgry_id = isset($_GET['ctgry_id']) ? $_GET['ctgry_id'] : 3; ?>
                <td colspan="4"><?php $this->_control('pagination', 'pgnv-n1', array('pagination' => $filepg, 'show_count'=>true, 'url_args'=>array('ctgry_id'=>$Gctgry_id, 'category'=>FileCategory::find('id = ?', $Gctgry_id)->query()->category))); ?></td>
            </tr>
            <?php if(!$files->isEmpty()) { ?>
                <?php foreach($files as $key => $file) { ?>
                <tr>
                    <td class="filename">
                    <a href="<?=url('utility/download', array('file_id'=>$file->file_id, 'mode'=>'file', 'filename'=>mb_substr($file->filename, 0, Q::ini('appini/ahref_title'), 'utf-8')));?>">
                    <?=$key+1;?>. <?=$file->filename;?></a></td>
                    <td class="downloadurl"><a href="<?=url('utility/download', array('file_id'=>$file->file_id, 'mode'=>'file', 'filename'=>mb_substr($file->filename, 0, Q::ini('appini/ahref_title'), 'utf-8')));?>">下载</a></td>
                    <td class="size"><?=$file->size;?></td>
                    <td class="created"><?=date('Y-m-d', $file->created);?></td>
                </tr>
                <?php } ?>
            <?php } else { ?>
            <tr>
                <td class="nodata">抱歉，没有符合您要求的文件，您可以 <a href="<?=url('File',array('ctgry_id'=>3));?>" style="text-decoration:underline;">查看全部下载文件</a></td>
            </tr>
            <?php } ?>
        </table>
    </div>

</div><!-- /container-->
<?php $this->_endblock('container'); ?>